package org.wsff.tools.api.gateway.core;

import java.io.Serializable;

/**
 * 网关上下文接口
 *
 * @author ryan
 * @version Id: GatewayContext.java, v 0.1 2022-01-18 18:26 ryan Exp $$
 */
public interface GatewayContext<Request extends Serializable, Response extends Serializable> extends Serializable {

    /**
     * get proxy name
     * 
     * @return get proxy name
     */
    String getName();

    /**
     * get proxy request.
     *
     * @return request
     */
    Request getRequest();

    /**
     * get proxy response.
     *
     * @return response
     */
    Response getResponse();

    /**
     * set proxy response.
     *
     * @param response response
     */
    void setResponse(Response response);

    /**
     * 添加扩展信息
     *
     * @param key key
     * @return value
     */
    Object getExt(String key);

    /**
     * 添加扩展信息
     *
     * @param key key
     * @param value value
     */
    void addExt(String key, Object value);


}
